package com.yujianweb.oop;

public class TestExtends {
}

class Person{
    String name;
    int height;
    public void rest(){
        System.out.println("休息");
    }
}

class Student extends Person{
    String major;   //专业

    public void study(){
        System.out.println("学习");
    }

    public Student(String name, int height, String major){
        this.name = name;
        this.height = height;
        this.major = major;
    }
}
